package cn.tedu._03vehicle.pojo.datatransferobject;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class UserRegParam {
    //@NotNull(message = "用户名不能为null")
    //@NotEmpty(message="用户名不能为null和空字符串")
    //@NotBlank(message="用户名不能为null和空字符串和空白串")
    //@Size(min = 6, max = 12, message = "用户名长度必须在6-12之间")
    @Pattern(
            regexp = "^(?:[\\u4e00-\\u9fa5]|[a-zA-Z]){1,14}$",
            message = "用户名必须为14个英文字符或7个汉字以内"
    )
    @Schema(description = "用户名", required = true, example = "宇智波佐助")
    private String username;
    @Pattern(
            regexp = "^(?!.*\\s)(?!.*[\\u4e00-\\u9fa5])(?=.*[A-Za-z])(?=.*\\d|.*[^\\w\\s])[\\w!\"#$%&'()*+,\\-./:;<=>?@\\[\\\\\\]^_`{|}~]{8,14}$",
            message = "密码必须包含字母、数字、标点符号中的至少两种，长度8-14个字符，不含空格和中文"
    )
    @Schema(description = "密码", required = true, example = "1234567890")
    private String password;
    @Email(message = "邮箱格式错误")
    @Schema(description = "邮箱", required = true, example = "1234@QQ.COM")
    private String email;
    @Schema(description = "手机号", required = true, example = "12399995555")
    private String phone;
}
